import axios from "axios";
import { get__token } from "../plugins/storege";
import { ElMessage } from "element-plus";
const instance = axios.create({
  // baseURL: 'https://shopadmin.lamamuying.com',
  // baseURL: 'http://timemeetyou.com:8889/api/private/v1/',
  baseURL: "https://www.aerowang.cn/api/private/v1/",
  timeout: 10000,
});
// 请求拦截器
instance.interceptors.request.use(
  (config) => {
    // 携带请求头
    config.headers.Authorization = get__token();
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);
// 响应拦截器
instance.interceptors.response.use(
  (config) => {
    if (config.status === 200) return config.data;
  },
  (error) => {
    return Promise.reject(error);
  }
);
export default instance;
